// index.js
const {imgUrl} = getApp().globalData
Page({
  data: {
    imgUrl: imgUrl + 'index/img/',
    forumColorEnum: ['#FD5344', '#FFA600', '#FFCC00'],
    forumEnum: [
      {
        title: 'AI行业对生活的冲击有多大',
        num: '788.1w'
      },
      {
        title: '这些工程不要投！',
        num: '288.1w'
      },
      {
        title: '投标正确姿势',
        num: '188.1w'
      },
      {
        title: '看完这些还不会写标书…',
        num: '88.1w'
      }
    ],
    menuEnum: [
      {
        label: '订阅内容'
      },
      {
        label: '数据定制'
      },
      {
        label: '需求调查'
      },
      {
        label: '需求审核'
      },
      {
        label: '专家论证'
      },
      {
        label: '可行报告'
      },
      {
        label: '投标编制'
      },
      {
        label: '方案优化'
      },
      {
        label: '建议书'
      },
      {
        label: '内控制度'
      },
      {
        label: '招采流程'
      },
      {
        label: '质疑投诉'
      },
      {
        label: '合同编制'
      },
      {
        label: '履约验收'
      },
      {
        label: '机构查验'
      },
      {
        label: '定制咨询'
      }
    ]
  },
  jumpTo(event) {
    const {type} = event.currentTarget.dataset
    if (type === '1') {
      wx.switchTab({
        url: '/pages/tender/tender',
      })
    } else if (type === '2') {
      // 业务咨询 
      wx.navigateTo({
        url: '/pages/businessConsulting/businessConsulting?index=' + 0,
      })
    } else if (type === '3') {
      wx.switchTab({
        url: '/pages/knowledge/knowledge',
      })
    } else if (type === '4') {
      wx.switchTab({
        url: '/pages/forum/forum',
      })
    } else if (type === '5') {
      wx.setStorageSync('tenderType', 'subscribe')
      wx.switchTab({
        url: '/pages/tender/tender',
      })
    } else if (type === '6') {
      // 专家入库
    } else if (type === '7') {
      // 报名入口
    }
  },
  toZixun(event) {
    const {index} = event.currentTarget.dataset
    if (index == 0) {
      wx.setStorageSync('tenderType', 'subscribe')
      wx.switchTab({
        url: '/pages/tender/tender',
      })
      return
    }
    wx.navigateTo({
      url: '/pages/businessConsulting/businessConsulting?index=' + index,
    })
  }
})
